<%@page import="java.util.ArrayList"%>
<%@ page import="bean.*"  %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Liste des patients</title>
</head>
<body>
<%@ include file="../commun_page_swmenufree/swmenufree.jsp" %>
<jsp:include page="${pageConfig.contenu}" />
<%
String sessionUser = (String) session.getAttribute("username");
if (sessionUser == null){
	response.sendRedirect("../modele/modele.jsp");
	return ;
}
%>

<h3>Liste des patients du Dr <%= sessionUser %></h3>

<table width="800">
<th>Nom</th><th>Prenom</th><th>Ville</th><th>Date de naissance</th><th>Modification</th>
<%
	
	ArrayList<Patient> tabPatient = new ArrayList<Patient>();
	
	tabPatient = Patient.listePatient();
	//out.println("<tr>");
	for (Patient patient : tabPatient) {
		out.println("<tr>");
		out.println("<td align='center'>"+patient.getNom()+"</td><td align='center'>"+patient.getPrenom()+
				"</td><td align='center'>"+patient.getVille()+"</td><td align='center'>"+
				patient.getDateNaissance()+"</td>");
		out.println("<td align='center'>"+
				"<a href=\"../patient/modifPatient.jsp?idPatient="+patient.getId()+"\"><img src=\"../images/modif.png\" border=0 /></a>"+
				"<a href=\"../patient/suprPatient.jsp?idPatient="+patient.getId()+"\"><img src=\"../images/croix.png\" border=0 /></a></td></tr>");
	}
	//out.println("</tr>");

%>
</table>

</body>
</html>